home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 44
/
Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso
/
Aminet
/
dev
/
gui
/
gtlayout.lha
/
Source
/
LTP_MoveToWindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-02
|
798b
|
44 lines
/*
** GadTools layout toolkit
**
** Copyright © 1993-1999 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif
#include "Assert.h"
VOID
LTP_MoveToWindow(LayoutHandle *handle)
{
if(V39)
{
WORD left,top,width,height;
LTP_GetDisplayClip(handle->Screen,&left,&top,&width,&height);
if(handle->Window->Width < width)
left = (width - handle->Window->Width) / 2;
else
left = 0;
if(handle->Window->Height < height)
top = (height - handle->Window->Height) / 2;
else
top = 0;
if((left = handle->Window->LeftEdge - left) < 0)
left = 0;
if((top = handle->Window->TopEdge - top) < 0)
top = 0;
ScreenPosition(handle->Screen,SPOS_MAKEVISIBLE,left,top,left + width - 1,top + height - 1);
}
}